home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / OutOfPhase1.01Source / OutOfPhase Folder / SymbolTableEntry.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  2.0 KB  |  73 lines  |  [TEXT/KAHL]

  1. /* SymbolTableEntry.h */
  2.  
  3. #ifndef Included_SymbolTableEntry_h
  4. #define Included_SymbolTableEntry_h
  5.  
  6. /* SymbolTableEntry module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* CRC32 */
  12. /* TrashTracker */
  13. /* Memory */
  14. /* PcodeObject */
  15. /* SymbolList */
  16.  
  17. #include "PcodeObject.h"
  18.  
  19. struct SymbolRec;
  20. typedef struct SymbolRec SymbolRec;
  21.  
  22. /* forwards */
  23. struct TrashTrackRec;
  24. struct SymbolListRec;
  25.  
  26. typedef enum
  27.     {
  28.         eSymbolUndefined EXECUTE(= -2351),
  29.         eSymbolVariable,
  30.         eSymbolFunction
  31.     } SymbolType;
  32.  
  33. /* this package allocates all data with TrashTracker */
  34.  
  35. /* create a new symbol table entry for a variable */
  36. SymbolRec*                NewSymbol(struct TrashTrackRec* Trash, char* String, long StringLength);
  37.  
  38. /* find out what the symbol is a symbol of */
  39. SymbolType                WhatIsThisSymbol(SymbolRec* Symbol);
  40.  
  41. /* get the hash value for the string */
  42. unsigned long            GetSymbolHashValue(SymbolRec* Symbol);
  43.  
  44. /* get a pointer to the actual string name of the variable */
  45. char*                            GetSymbolName(SymbolRec* Symbol);
  46.  
  47. /* make symbol into a variable symbol */
  48. void                            SymbolBecomeVariable(SymbolRec* Symbol, DataTypes VarType);
  49.  
  50. /* get the object type for the variable */
  51. DataTypes                    GetSymbolVariableDataType(SymbolRec* Symbol);
  52.  
  53. /* make variable know where on the stack it lives.  must be a positive number */
  54. void                            SetSymbolVariableStackLocation(SymbolRec* Symbol, long StackLoc);
  55.  
  56. /* find out where on the stack a variable lives. */
  57. long                            GetSymbolVariableStackLocation(SymbolRec* Symbol);
  58.  
  59. /* make symbol into a function symbol */
  60. void                            SymbolBecomeFunction(SymbolRec* Symbol, struct SymbolListRec* ArgList,
  61.                                         DataTypes ReturnType);
  62.  
  63. /* get the return type for the function */
  64. DataTypes                    GetSymbolFunctionReturnType(SymbolRec* Symbol);
  65.  
  66. /* get the list of symbol table entries from a function call argument list */
  67. struct SymbolListRec*    GetSymbolFunctionArgList(SymbolRec* Symbol);
  68.  
  69. /* perform a hash on a name */
  70. unsigned long            UseSymbolTableHash(char* String, long Length);
  71.  
  72. #endif
  73.